﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Open.Data.Persistence
{
    public class ExpressionGroup : Expression
    {
        //Properties
        public Expression Expression { get; set; }

        //Constructors
        public ExpressionGroup(Expression expression)
        {
            Expression = expression;
        }

        public override IEnumerable<IParameter> GetParameters()
        {
            foreach (IParameter parameter in Expression.GetParameters())
            {
                yield return parameter;
            }
        }

        public override void AppendHashCode(StringBuilder builder)
        {
            builder.Append(typeof(ExpressionGroup).FullName);
            Expression.AppendHashCode(builder);
        }
    }
}
